const collections = require("express").Router();
const CollectionController = require("../../../controllers/collection");
const { Validator, collection } = require("../../../validators");

// 壁纸集合列表
collections.get("/", CollectionController.list);

// 新增壁纸集合
collections.post("/", Validator(collection.add), CollectionController.add);

// 删除壁纸集合
collections.delete(
    "/:id",
    Validator(collection.delete),
    CollectionController.delete
);

// 修改壁纸集合
collections.patch(
    "/:id",
    Validator(collection.update),
    CollectionController.update
);

// 获取图集下的壁纸列表
collections.get(
    "/:id/wallpapers",
    Validator(collection.wallpapers),
    CollectionController.wallpapers
);

module.exports = collections;
